#!/usr/bin/env python

import searchengine
s=searchengine.searcher('searchindex.db')
c=raw_input()
doit=True
while(doit):
	s.query(c)
	try:
		c=raw_input()
	except:
		doit=False
